#!/bin/bash

# tail -f /opt/README.md

# 检查目录
if [ ! -e /opt/logs ]; then mkdir -p /opt/logs; fi
if [ ! -e /opt/iClouds/pages ]; then mkdir -p /opt/iClouds/pages; fi
if [ ! -e /opt/statics/js ]; then mkdir -p /opt/statics/js; fi
# 切换模式
sed -i "s/DEBUG = True/DEBUG = False/g" /opt/iClouds/iClouds/settings.py
sed -i "s/DOCS = True/DOCS = False/g" /opt/iClouds/iClouds/settings.py
# 初始化
python3 /opt/iClouds/manage.py inited
# 启动服务
supervisord -c /opt/supervisor/supervisord.conf
# 阻塞进程
tail -f /opt/README.md